package edu.whut.mall.user.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * Author: smq
 * Unit: D9lab
 * Date: 2021-06-07 16:15
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Address {
    @TableId(type = IdType.AUTO)
    private int id;
    private int userId;
    private int areaCode;
    private Double lng;
    private Double lat;
    private String address;
    private boolean isDeleted;
    private Date createTime;
    private Date updateTime;
    private String realName;
    private String phone;
    private boolean isDefault;

    public Address(int userId, int areaCode, Double lng, Double lat, String address, String realName, String phone) {
        this.userId = userId;
        this.areaCode = areaCode;
        this.lng = lng;
        this.lat = lat;
        this.address = address;
        this.isDeleted = false;
        this.createTime = new Date();
        this.realName = realName;
        this.phone = phone;
        this.isDefault = false;
    }
}